package com.service.aliyun;

import java.io.InputStream;
import java.util.Map;

import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.ObjectMetadata;

/**
 * @author geliyang
 *
 */
public interface IOssService {

	/**
	 * 上传OSS文件
	 * @param filekey 如：test.txt,  testFolder/test.txt
	 * @param is 输入流
	 * @return
	 */
	public Integer OSSUpload(String filekey, InputStream is) throws OSSException, ClientException, Exception;
	public Integer OSSUpload(String filekey, InputStream is,ObjectMetadata meta) throws OSSException, ClientException, Exception;
	
	/**
	 * 删除OSS文件
	 * @param filekey 如：test.txt,  testFolder/test.txt
	 * @return
	 */
	public Integer OSSDelete(String filekey) throws OSSException, ClientException, Exception;
	
	/**
	 * 返回oss和cdn地址
	 * @param pakg oss上文件夹名
	 * @param fileName 文件名
	 * @return map 值分别是map.get("cdnUrl"),map.get("ossUrl")
	 */
	public Map<String,String> fillOssAndCdnPath(String pakg, String fileName);
	
}
